package com.guhappy.util;

import java.util.ResourceBundle;

public class PropertiesReader
{
	public static final String HIBERNATE_ONLINE_MAPPING =
	        "hibernate.online.mapping";

	//	------------------------------------------------------------------
	//       DAO Keys
	//------------------------------------------------------------------
	public static final String RESOURCE_BUNDLE_NAME = "beans"; 
	public static final String SECURITY_POLICY_KEY = "SECURITY_POLICY_KEY";

	//DAOs
	/*public static final String DAO_USER_PROFILE_KEY = "DAO_USER_PROFILE";
	public static final String DAO_DEAL_KEY = "DAO_DEAL";
	public static final String DAO_FIRM_PROFILE_KEY = "DAO_FIRM_PROFILE";
	public static final String DAO_MORTGAGE_KEY = "DAO_MORTGAGE";
	public static final String DAO_BEANHELPER_KEY = "DAO_BEANHELPER";
	public static final String DAO_INSURANCE_APP_KEY = "DAO_INSURANCE_APP_KEY";
	public static final String DAO_CONTACT_KEY = "DAO_CONTACT_KEY";
	public static final String DAO_PARTYPROFILE_KEY = "DAO_PARTYPROFILE_KEY";
	public static final String DAO_CREDITBUREAU_KEY = "DAO_CREDITBUREAU_KEY";
	public static final String DAO_CMX_COMMITMENT_KEY = "DAO_CMX_COMMITMENT_KEY";
	public static final String DAO_FIRM_CRM_KEY = "DAO_FIRM_CRM";
	public static final String DAO_LENDER_SUBMISSION_KEY = "DAO_LENDER_SUBMISSION";
	public static final String DAO_GROUP_PROFILE_KEY = "DAO_GROUP_PROFILE";
	public static final String DAO_REGION_PROFILE_KEY = "DAO_REGION_PROFILE";
	public static final String DAO_FIRM_SERVICE_ASSOC = "DAO_FIRM_SERVICE_ASSOC"; /** added by Senthuran Sivananthan 06Mar05 */
	//public static final String DAO_USER_ROLE_ASSOC = "DAO_USER_ROLE_ASSOC"; /** added by Senthuran Sivananthan 30May05 */
	//public static final String DAO_ORGANIZATION_PROFILE = "DAO_ORGANIZATION_PROFILE"; /** added by Senthuran Sivananthan 03June05 */
	//public static final String DAO_CNVREF_FIRM_USER = "DAO_CNVREF_FIRM_USER"; /** added by Senthuran Sivananthan 20December05 */

////	public static final String SYSTEM_TOTAL_LOGIN_ATTEMPTS_KEY = "SYSTEM_TOTAL_LOGIN_ATTEMPTS";
//	public static final String PASSWORD_POLICY_ALLOWED_AUTH_ATTEMPTS_KEY = "PASSWORD_POLICY_ALLOWED_AUTH_ATTEMPTS";
//	public static final String PASSWORD_POLICY_CHANGE_DAYS_KEY = "PASSWORD_POLICY_CHANGE_DAYS";
//	public static final String PASSWORD_POLICY_GRACE_LOGINS_KEY = "PASSWORD_POLICY_GRACE_LOGINS";
//	public static final String PASSWORD_POLICY_WARN_DAYS_KEY = "PASSWORD_POLICY_WARN_DAYS";
//	public static final String PASSWORD_POLICY_PASSWORD_STRENGTH_KEY = "PASSWORD_POLICY_PASSWORD_STRENGTH";
//	public static final String PASSWORD_POLICY_PASSWORD_MIN_LENGTH_KEY = "PASSWORD_POLICY_PASSWORD_MIN_LENGTH";
//	public static final String PASSWORD_POLICY_PASSWORD_MAX_FAILED_KEY = "PASSWORD_POLICY_PASSWORD_MAX_FAILED";
//	public static final String PASSWORD_POLICY_PASSWORD_RETENTION_KEY = "PASSWORD_POLICY_PASSWORD_RETENTION";
//	public static final String PASSWORD_POLICY_NEWPASSWORD_VALID_DAYS_KEY = "PASSWORD_POLICY_NEWPASSWORD_VALID_DAYS";
//	public static final String PASSWORD_POLICY_PASSWORD_REUSE_TIMES_KEY = "PASSWORD_POLICY_PASSWORD_REUSE_TIMES";
//	public static final String PASSWORD_POLICY_MIN_PASSWORD_AGE_DAYS_KEY = "PASSWORD_POLICY_MIN_PASSWORD_AGE_DAYS";
	
	/*public static final String DAO_PASSWORD_RESET_KEY = "DAO_PASSWORD_RESET_KEY"; //Password Reset Change
	
	public static final String DAO_DROP_DOWN_KEY = "DAO_DROP_DOWN_KEY";
	public static final String DATASOURCE_JNDI = "DATASOURCE_JNDI";
	public static final String DAO_IMPL_PACKAGE_PREFIX =
	        "expert.impl.package.prefix";
	public static final String DAO_IMPL_PACKAGE_SUFFIX =
	        "expert.impl.package.suffix";
	public static final String DAO_OBJ_SUFFIX = "expert.impl.object.suffix";

	//	------------------------------------------------------------------
	//       Error Keys
	//------------------------------------------------------------------
	public static final String ERROR_RETURN_CONTEXT_PATH =
	        "error.returnContextPath";
	public static final String ERROR_ERROR_MESSAGE = "error.errorMessage";
	public static final String ERROR_SESSION_REQUIRED = "error.sessionRequired";
	public static final String ERROR_FORWARD_URL = "error.forwardUrl";
	public static final String ERROR_PAGE_TITLE = "error.pageTitle";
	public static final String ERROR_OK_BUTTON_ENABLED = "error.okButton";

	//	------------------------------------------------------------------
	//       Transaction History
	//------------------------------------------------------------------
	public static final String ENABLE_TRANSACTION_HISTORY = "ENABLE_TRANSACTION_HISTORY";
	public static final String TRANSACTION_HISTORY_LOGGING_TYPE = "TRANSACTION_HISTORY_LOGGING_TYPE";
	
	//  default elearning url and help file
	public static final String ELEARNING_URL="expert.elearning.url.default.english";
	public static final String HELP_FILE_NAME="expert.helpfiles.url.default.english";
	*/
	//get keys from the properties file
	public static final String getStringValue(String key)
	{
		ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_BUNDLE_NAME);
		return rb.getString(key);
	}

	//gets the key value as an Integer
	public static final Integer getIntegerValue(String key)
	{
		ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_BUNDLE_NAME);
		String strValue = rb.getString(key);
		if (strValue == null)
		{
			return null;
		}

		try
		{
			return new Integer(strValue);
		}
		catch (NumberFormatException e)
		{
			return null;
		}
	}
}
